home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacPeople 2003 February 1
/
MACPEOPLE-2003-02-01.ISO.7z
/
MACPEOPLE-2003-02-01.ISO
/
ぶらりオンラインウェアの旅
/
おしゃべり漂流記
/
xGates
/
xGates 1.2 Source Code.sit
/
xGates 1.2 Source Code
/
sound.c
< prev
next >
Wrap
Text File
|
2002-11-24
|
2KB
|
83 lines
/*
xGates -- Stunningly entertaining action game for MacOS Classic / MacOS X
Copyright (C) 2002 Sveinbjorn Thordarson <paladeen@soth.zoneit.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
sound.c
*/
#include "externs.h"
#include "prototypes.h"
#include "definitions.h"
//////////////////////////////////////////////////////
//Silence sound channel
//////////////////////////////////////////////////////
void SilenceChannel(SndChannelPtr theChannel)
{
SndCommand theCmd;
theCmd.param1 = 0;
theCmd.param2 = 0;
theCmd.cmd = quietCmd;
SndDoImmediate(theChannel, &theCmd);
theCmd.cmd = flushCmd;
SndDoImmediate(theChannel, &theCmd);
}
//////////////////////////////////////////////////////
//Silence them all!
//////////////////////////////////////////////////////
void SilenceAllChannels (void)
{
SilenceChannel(weaponSndChannel);
SilenceChannel(billSndChannel);
SilenceChannel(steveSndChannel);
SilenceChannel(computerSndChannel);
SilenceChannel(musicSndChannel);
SilenceChannel(dojSndChannel);
SilenceChannel(otherSndChannel);
}
//////////////////////////////////////////////////////
//Check if looped music is finished. If not, nothing,
//otherwise, it's ,,Play it again, Sam"
//////////////////////////////////////////////////////
void ServiceMusic(void)
{
SCStatus musicChannelStatus;
if(prefs.music == true)
{
SndChannelStatus(musicSndChannel, sizeof(SCStatus), &musicChannelStatus);
if(!musicChannelStatus.scChannelBusy)
{
SndPlay(musicSndChannel, (SndListHandle)musicSounds[levels[currentLevel].musicNum], true);
}
}
}